import React from 'react'
import {ToolBar} from './toolbar/ToolBar'
import {Diagram} from '../../components/Diagram'

export class Canvas extends React.Component {
    render () {
        const {model, updateModel, selectedNode, onUndo, onRedo, canUndo, canRedo, onNodeSelected, fullScreen, ...attributes} = this.props
        return (
            <div className="canvas">
                    <ToolBar
                        selectedNode={selectedNode}
                        onUndo={onUndo}
                        onRedo={onRedo}
                        canUndo={canUndo}
                        canRedo={canRedo}
                        fullScreen={fullScreen}
                    ></ToolBar>
                    <Diagram
                        model={model}
                        updateModel={updateModel}
                        onNodeSelected={onNodeSelected}
                        {...attributes}>
                    </Diagram>
            </div>
        )
    }
}
